<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<meta name="decorator" content="sysDefault" />
	<script type="text/javascript">
		$(document).ready(function() {
			
		
			$("#name").focus();
			$("#menuForm").validate({
				submitHandler: function(form){
					Oosp_Loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			

		});
		
		
	function changeSelect(id,value){
		$(""+id+"").val(value);
	}
	</script>
</head>
<body>
 

		<div class="row">
		<form:form id="menuForm" modelAttribute="menu" action="${contextPath}/sys/site/menu/save" method="post" class="form-horizontal" role="form">
			<div class="col-xs-12">
				<div class="panel panel-default">
				  <div class="panel-heading">
				    <h3 class="panel-title">菜单新增
						<a class="btn btn-default btn-sm pull-right" role="button" href="javascript:void(0)" onclick="history.go(-1)">返回</a>
				    </h3>
				  </div>
				  
					
						<form:hidden path="id"/>
						<form:hidden path="desc" value="${menu.desc}"/>
						<form:hidden path="isShow" value="${menu.isShow}"/>
						<form:hidden path="parentid" value="${menu.parentid}" />
						<form:hidden path="isParent" value="${menu.isParent}" />
						<form:hidden path="interval" value="${menu.interval}" />
						<form:hidden path="isBar" value="${menu.isBar}" />
						<form:hidden path="level" value="${menu.level}" />
						<form:hidden path="isLast" value="${menu.isLast}" />
						<tags:message content="${message}"/>
						<div class="form-group">
							<label for="name" class="col-sm-1 control-label">名称:</label>
							<div class="col-sm-10">
								<form:input id="name" path="name" maxlength="200" class="form-control required"/>
							</div>
							
						</div>
						<div class="form-group">
						<label for="href" class="col-sm-1 control-label">链接地址:</label>
							<div class="col-sm-10">
								<form:input id="href" path="href" maxlength="200" class="form-control required"/>
							</div>
						</div>
						<div class="form-group">
						
						<label for="traget" class="col-sm-1 control-label">TARGET:</label>
							<div class="col-sm-2">
								<form:input id="target" path="target" value="${menu.target}" maxlength="50" class="form-control required"/>
							</div>
						
							
						<label for="parent" class="col-sm-2 control-label">上级节点名称:</label>
						 <div class="col-sm-2">
								<form:input id="parent" path="parent" value="${menu.parent.name}" maxlength="200" class="form-control" disabled="true"/>
					     </div>
						</div>
						
						<div class="form-group">
						<label for="icon" class="col-sm-1 control-label">图标地址:</label>
							<div class="col-sm-5">
								<span id="img" class="glyphicon glyphicon-chevron-left"></span>
								<a  href="#" data-toggle="modal" data-target="#myModal" >选择</a>
								<form:hidden id="icon"  path="icon" value="/static/lib/ztree/3.5/css/zTreeStyle/img/diy/2.png" maxlength="200" class="form-control" />
							</div>
					
						</div>
						<div class="form-group">
						
							<label for="isShow" class="col-sm-1 control-label">显示菜单:</label>
								<div class="col-sm-3">
								<ossp:radio name="isShow" id="isShow" dictType="menShow" 
								defaultChecked="${menu.isShow}" 
								onchange="changeSelect('#isShow',this.value)"></ossp:radio>
							</div>
			
						</div>
						<div class="form-group">
						    <label for="isBar" class="col-sm-1 control-label">栏位:</label>
						   <div class="col-sm-3">
								<ossp:radio  name="isBar" id="isBar" defaultChecked="${menu.isBar}" dictType="isBar" 
								type="radio"
								onchange="changeSelect('#isBar',this.value)"></ossp:radio>
							</div>
					 </div>
						<div class="form-group">
						 	<div class="col-sm-6">
							    <label for="createBy" class="col-sm-2 control-label">创建人:</label>
								<div class="col-sm-8">
									<form:hidden path="createBy"/>
									<form:input id="createBy" path="createBy" htmlEscape="false"  class="form-control" disabled="true"/>
																</div>
						  	</div>
						  	<div class="col-sm-6">
							    <label for="createTime" class="col-sm-2 control-label">创建时间:</label>
								<div class="col-sm-8">
									<form:hidden id="createTime" path="createTime" value="${menu.createTime}" />
									<input id="createTime" name="createTime" type="text" disabled class="form-control"
										value="<fmt:formatDate value="${menu.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
								</div>
						 	</div>
						</div>
						<div class="form-group">
						 	<div class="col-sm-6">
							    <label for="updateBy" class="col-sm-2 control-label">修改人:</label>
								<div class="col-sm-8">
									<form:hidden path="updateBy"/>
									<form:input id="updateBy" path="updateBy" class="form-control" disabled="true"/>
								</div>
						  	</div>
						  	<div class="col-sm-6">
							    <label for="updateTime" class="col-sm-2 control-label">修改时间:</label>
								<div class="col-sm-8">
									<form:hidden path="updateTime"/>
									<input id="updateTime" name="updateTime" type="text" disabled class="form-control"
										value="<fmt:formatDate value="${menu.updateTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
								</div>
						 	</div>
						</div>
						<div class="form-group">
						  <div class="col-sm-offset-1 col-sm-10">
						    <input class="btn btn-primary" type="submit" value="保 存"/>
							<input class="btn btn-default" type="button" value="返 回" onclick="history.go(-1)"/>
						  </div>
						</div>
					
				  </div>
				</div>	
				</form:form>		
			</div>
		
		
		<!-- Modal -->
		<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		  <div class="modal-dialog">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		        <h4 class="modal-title" id="myModalLabel">选取图标</h4>
		      </div>
		       <div class="modal-body">
		       
		       </div>
		      <div class="modal-body">
		     
					<a href="#"><span class="glyphicon glyphicon-search"></span></a>
					<a href="#"><span class="glyphicon glyphicon-adjust"></span></a>
					<a href="#"><span class="glyphicon glyphicon-align-center"></span></a>
					
					<a href="#"><span class="glyphicon glyphicon-align-left"></span></a>
					<a href="#"><span class="glyphicon glyphicon-align-right"></span></a>
					<a href="#"><span class="glyphicon glyphicon-arrow-down"></span></a>
					<a href="#"><span class="glyphicon glyphicon-arrow-left"></span></a>	
					
					<a href="#"><span class="glyphicon glyphicon-arrow-right"></span></a>
					<a href="#"><span class="glyphicon glyphicon-arrow-upt"></span></a>
					<a href="#"><span class="glyphicon glyphicon-asterisk"></span></a>
					<a href="#"><span class="glyphicon glyphicon-backward"></span></a>
					
					<a href="#"><span class="glyphicon glyphicon-ban-circle"></span></a>
					<a href="#"><span class="glyphicon glyphicon-barcode"></span></a>
					<a href="#"><span class="glyphicon glyphicon-bell"></span></a>
					<a href="#"><span class="glyphicon glyphicon-bold"></span></a>	
					
					
					<a href="#"><span class="glyphicon glyphicon-book"></span></a>
					<a href="#"><span class="glyphicon glyphicon-bookmark"></span></a>
					<a href="#"><span class="glyphicon glyphicon-briefcase"></span></a>
					<a href="#"><span class="glyphicon glyphicon-bullhorn"></span></a>	
					
					
					<a href="#"><span class="glyphicon glyphicon-camera"></span></a>
					<a href="#"><span class="glyphicon glyphicon-certificate"></span></a>
					<a href="#"><span class="glyphicon glyphicon-check"></span></a>
					<a href="#"><span class="glyphicon glyphicon-chevron-down"></span></a>	
					
					
					<a href="#"><span class="glyphicon glyphicon-chevron-left"></span></a>	
					<a href="#"><span class="glyphicon glyphicon-chevron-right"></span></a>
					<a href="#"><span class="glyphicon glyphicon-chevron-up"></span></a>
					<a href="#"><span class="glyphicon glyphicon-circle-arrow-down"></span></a>
					<a href="#"><span class="glyphicon glyphicon-circle-arrow-left"></span></a>	
					
					<a href="#"><span class="glyphicon glyphicon-circle-arrow-right"></span></a>	
					<a href="#"><span class="glyphicon glyphicon-circle-arrow-up"></span></a>
					<a href="#"><span class="glyphicon glyphicon-cloud"></span></a>
					<a href="#"><span class="glyphicon glyphicon-cloud-upload"></span></a>
					<a href="#"><span class="glyphicon glyphicon-cog"></span></a>	
					
					
					<a href="#"><span class="glyphicon glyphicon-collapse-down"></span></a>	
					<a href="#"><span class="glyphicon glyphicon-collapse-up"></span></a>
					<a href="#"><span class="glyphicon glyphicon-comment"></span></a>
					<a href="#"><span class="glyphicon glyphicon-compressed"></span></a>
					<a href="#"><span class="glyphicon glyphicon-copyright-mark"></span></a>	
					
					<a href="#"><span class="glyphicon glyphicon-folder-close"></span></a>	
					
					<a href="#"><span class="glyphicon glyphicon-folder-open"></span></a>			
		      </div>
		      <div class="modal-footer">
		        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
		      </div>
		    </div><!-- /.modal-content -->
		  </div><!-- /.modal-dialog -->
		</div>
<!-- /.modal -->
	
</body>
</html>